package utils

import (
	"strconv"
	"unsafe"
)

//将字符串转成int

func StrToInt(str string) int32 {
	value_int64,_:=strconv.ParseInt(str,10,64)
	value_int:=*(*int32)(unsafe.Pointer(&value_int64))
	return value_int
}

func StrToFloat32(str string) float32 {
	value_float64,_:=strconv.ParseFloat(str,64)
	//value_float:=*(*float32)(unsafe.Pointer(&value_float64))
	return float32(value_float64)
}